<template>
  <!--项目计划信息  -->
  <div>
    <FormPanel
      ref="formPanel"
      :list="initForm"
      :cols="2"
      formType="show"
      :labelWidth="140"
      :isSubmitBtn="false"
      @formChange="formChangeHandle"
    />
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import { formatdateByDay } from '@/utils';
import { region } from '@/api/cms-common/region';
export default {
  mixins: [dictionary, region],
  props: {
    value: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      initForm: this.initFormFun(),
      formValue: {}
    };
  },
  mounted() {
    //请求接口进行赋值，自己写吧
  },
  methods: {
   
    init() {
        this.initForm.forEach(x => {
          x.initialValue = this.value.row[x.fieldName];
        });
    },
    //搜索数据
    initFormFun() {
      return [
        {
          type: 'INPUT',
          label: '项目编号',
          fieldName: 'planCode',
          initialValue: '',
          placeholder: ''
        },
        {
          type: 'SELECT',
          label: '项目状态',
          fieldName: 'planStatus',
          initialValue: '',
          placeholder: '',
          itemList: this.createDictList('2531')
        },
         {
          type: 'INPUT',
          label: '方案编号',
          fieldName: 'programCode',
          initialValue: '',
          placeholder: ''
        },
        {
          type: 'INPUT',
          label: '项目大类',
          fieldName: 'projectMainClassName',
          initialValue: '',
          placeholder: ''
        },
        {
          type: 'TEXT_AREA',
          label: '方案名称',
          fieldName: 'programName',
          initialValue: '',
          rows:4,
          placeholder: ''
        },
        {
          type: 'INPUT',
          label: '项目小类',
          fieldName: 'projectSmallClassName',
          initialValue: '',
          placeholder: ''
        },
  
        {
          type: 'DATE',
          label: '项目月份',
          fieldName: 'activityMonth',
          initialValue: '',
          placeholder: '',
          dateType: 'month'
        }
      ];
    },
    formChangeHandle(val) {
      this.formValue = val;
    }
  },
  created() {
    this.init();
  }
};
</script>
